//
//  M3Subscription.h
// 
//
//  Created by xm on 2023/8/31.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

typedef void(^M3SubscriptionBlock)(id _Nullable payload);


@interface M3Subscription : NSObject



@property(nonatomic, assign) NSInteger code;
@property(nonatomic, copy) M3SubscriptionBlock block;
@property(nonatomic, weak) id _Nullable caller;
@property(nonatomic, copy) NSString* _Nullable tag;
@property(nonatomic, copy) NSString* callerName;


-(instancetype) initWithCaller:(id) caller code:(NSInteger ) code block:(M3SubscriptionBlock) block;
+(instancetype) subscriptionWithCaller:(id) caller code:(NSInteger ) code block:(M3SubscriptionBlock) block;

@end

NS_ASSUME_NONNULL_END
